import { Router } from 'express';

import Paths from '@src/common/constants/Paths';
import authRouter from './auth';
import adminRouter from './admin';
import liveRouter from './live';
import chatRouter from './chat';
import contentRouter from './content';
import payRouter from './pay';
import liveGiftRouter from './live-gift';

/******************************************************************************
                                Setup
******************************************************************************/

const apiRouter = Router();

// Health endpoint: GET /api/health
apiRouter.get(Paths.Health, (_req, res) => {
  res.status(200).json({ status: 'ok' });
});

// Auth routes: /api/auth
apiRouter.use(Paths.Auth.Base, authRouter);

// Admin routes: /api/admin
apiRouter.use(Paths.Admin.Base, adminRouter);

// Live routes: /api/live
apiRouter.use(Paths.Live.Base, liveRouter);
// Live gift routes (send gift)
apiRouter.use(Paths.Live.Base, liveGiftRouter);

// Chat routes: /api/chat
apiRouter.use(Paths.Chat.Base, chatRouter);

// Content routes: /api/content
apiRouter.use(Paths.Content.Base, contentRouter);

// Pay routes: /api/pay
apiRouter.use(Paths.Pay.Base, payRouter);

/******************************************************************************
                                Export default
******************************************************************************/

export default apiRouter;
